package org.dlust.aspect;

import org.aspectj.lang.annotation.*;

@Aspect
public class LogAspects {

  @Pointcut("execution(public int org.dlust.entity.Calculator.*(..))")
  public void pointCut() {}

  @Before("pointCut()")
  public void logStart() {
    System.out.println("除法运行... 参数是： {}");
  }

  @After("pointCut()")
  public void logEnd() {
    System.out.println("除法结束... ");
  }

  @AfterReturning("pointCut()")
  public void logReturn() {
    System.out.println("除法正常返回... 结果是： {}");
  }

  @AfterThrowing("pointCut()")
  public void logException() {
    System.out.println("运行异常... 异常信息是： {}");
  }
}
